<?php

namespace App\Entity;

use ApiPlatform\Core\Annotation\ApiResource;
use App\Base\Annotation\Common;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;

/**
 * @ApiResource()
 * @ORM\Entity(repositoryClass="App\Repository\ConfigRepository")
 */
class Config
{
    /**
     * @Common(cnName="#",editType="text",listType="text")
     * @ORM\Id()
     * @ORM\GeneratedValue()
     * @ORM\Column(type="integer")
     * @Groups({"app"})
     */
    private $id;

    /**
     * @Common(cnName="分组",editType="select",listType="text")
     * @ORM\ManyToOne(targetEntity="App\Entity\ComCategory", inversedBy="configs")
     * @Groups({"com"})
     */
    private $cat;

    /**
     * @Common(cnName="KEY",editType="text",listType="text",width="150")
     * @Groups({"app"})
     * @ORM\Column(type="string", length=255)
     */
    private $k;

    /**
     * @Common(cnName="VALUE",editType="text",listType="text",width="")
     * @Groups({"app"})
     * @ORM\Column(type="text", nullable=true)
     */
    private $v;

    /**
     * @Common(cnName="PIC",editType="pic",listType="text",width="")
     * @Groups({"app"})
     * @ORM\Column(type="text", nullable=true)
     */
    private $pic;

    /**
     * @Common(cnName="说明",editType="text",listType="text",width="")
     * @Groups({"app"})
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $tips;

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getCat(): ?ComCategory
    {
        return $this->cat;
    }

    public function setCat(?ComCategory $cat): self
    {
        $this->cat = $cat;

        return $this;
    }

    public function getK(): ?string
    {
        return $this->k;
    }

    public function setK(string $k): self
    {
        $this->k = $k;

        return $this;
    }

    public function getV(): ?string
    {
        return $this->v;
    }

    public function setV(?string $v): self
    {
        $this->v = $v;

        return $this;
    }

    public function getTips(): ?string
    {
        return $this->tips;
    }

    public function setTips(?string $tips): self
    {
        $this->tips = $tips;

        return $this;
    }

    public function getPic(): ?string
    {
        return $this->pic;
    }

    public function setPic(?string $pic): self
    {
        $this->pic = $pic;

        return $this;
    }
}
